Getting the most out of your graphics adapter with video memory remapping. Graphics resolution and color are attractive features of the VGA, but some of their other useful features are often overlooked. The ability to pan the screen image both horizontally and vertically can greatly expand EGA/VGA's usefulness. This article explains how to remap the video memory to allow this kind of pixel panning. Powerful hardware tools for complicated problem solving The software-only debuggers that come with assemblers and compilers are usually designed for solving problems at the applications level. Although some of these products can also help debug terminate-and-stay-resident (TSR) programs, it is difficult or impossible to use them when debugging problems involving device drivers, hardware interrupt service routines, real-time interactions between two or more programs, or a hung system. Hardware-assisted debuggers use a combination of hardware and software to enable you to solve these more complex kinds of problems. Levels of hardware assistance in these debuggers include a break-out switch, protected or hidden memory, real-time breakpoints, and a real-time trace buffer. Writing Portable code to access SCSI devices using the Common Access Method. The ANSI-standard, high-speed I/O bus known as the SCSI (Small Computer System Interface) is supported by an unprecedented variety of computers and peripherals. If you own a Mac, a Sun, a NeXT, or an Amiga with a hard disk, you're probably already using SCSI, whether you know it or not. The smae is true if you have a PC clone with a Bernoulli box, a CD-ROM, a magnetopoptical disk, or a WORM drive. When you need more speed and greater capacity. As one of the programmers at a developer of CAD software for printed circuit-board design, I was assigned the job of porting our CAD programs from Microsoft C 4.0 to an 80386 protected-mode compiler. After making a quick study of the three Microway, High-C 386 from MetaWare, and Watcom 7.0/386 from Watcom-- we chose the Watcom compiler. This article describes the problems and solutions we encountered in the process of porting 75,000 lines of C. Detect memory allocation errors automatically. Originally the program was small, less than 20,000 lines, and command-line driven. But after two years, four different programmers, and the addition of a lot of functionality -- a nifty graphical user interface, multiple printer support, foreign language menus, and a kitchen sink -- the program grew to 150,000 lines. Then it started CRASHING. The unique features of this special-purpose language can greatly improve development time. The AWK language is one of the gifts that the Unix environment has given to us. Named for the intials of its developers (Alfred Aho, Peter Weinberger, and Brian Kernighan), AWK was originally designed to be a simple utility for "quick and dirty" programming tasks. Since then it gradually evolved into a powerful tool capable of performing many time-saving tasks for programmers. Drawing objects that contain curves. Lisp is an excellent language for developing high-level AI programs. In particular Allergro Common Lisp (Allegro CL) has made the McIntosh an excellent platform for developing AI software. All implementations of Common Lisp including Allegro CL, are limited by some serious drawbacks. Commnuications to graphics and audio devices are not specified and Common Lisp does not even define access to physical devices. (A trap mechanism in Allegro CL does permit communication to the MacIntosh Toolbox, but this mechanism is very limited.) Additionally, complex mathematical computations, such as geometric transforms or statistical analysis, are extremely slow in any implementation of Lisp. Taking advantage of variable argument lists in C. While writing my first serious financial program in C (I'd previously used the language only for utilities), I was distressed by the lack of suitable output formatting -- specifically, comma-separated numbers with trailing signs. After working with Cobol financial applications several years, I expected such niceties from any language. When your text-based application can no longer deal with the memory-hungry real world, it's time to go virtual. Stephen shows you how to select and develop an application-supported virtual memory system that can take advantage of EMS paging and disk storage. John examines string hashing functions for fast table lookup and explains why a hash table, unlike your car's gas tank, should never be full. He also creates equivalent functions in assembly language for Windows 3.0 routines that manage handle-based dynamic storage and atoms (hashed strings). Installment21: In which we carry on with VGA color. When last we left our hero, he/she (take your pick) had learned how to set the VGA's Digital to Analog Converter (DAC) to select 16 or 256 colors from a set of 256k colors. However, there was still a great deal to learn about color paging, loading and reading the DAC, and color cycling, so that's the direction we're headed next. Before we begin, though, let me clear up a potential problem with C code from earlier installments. In the old days, a reasonable C preprocessor read an input file, discarded comments and excess white space (spaces, tabs, and new lines), built tokens (character sequences), substituted definitions, and expanded macro definitions. It didn't care when expansions and substitutions were done. Probably the most challenging aspect of the preprocessor was handling macro expansions and argument substitutions in a constrained memory space. The PC presented two problems: segmented memory architecture due to the Intel microprocessor's 64k-byte maximum segment size and DOS's 640K maximum memory size. My own perspective is that one learns more from 'details' that from generalities. Lots of articles and books cover material at the general level, so this article will focus on the details--how b-tree indexing is implemented in several dbase-compatible products. My interest is not solely acedemic, but stems also from several years of real-world database programming conducted for the the State of Oregon. A few years ago language vendors predicted their compilers would soon generate code that would be nearly as efficient as assembly language code. They were wrong. C is a great programming language. It's complicated enough to scare away beginners, fun to program, and efficient. Of course, assembly language is more is more complicated, more fun, and more efficient. With due respect to Watcom, Micrsoft C is about as good a 80x86 C compilers get. Bill Gates spends more dough on his C compiler than anyone else, yet it doesn't touch assembly language. One of the more appealing features of the VGA is the ability to display 256 simultaneous colors. Unfortunately, one of the less appealing features of the VGA is the limited resolution (320 X 200) of the 256-color mode the BIOS supports. More color can often compensate for less resolution, but the resolution difference between the 640 x 480 16 color mode and the 320 x 200 256 color mode is so great that many programmers must regretfully decide that they simply can't afford to use the 256-color mode. Writing a terminal emulator in Windows offers many chalenges not normally encountered in the character-based DOS world. But if you can overcome the sometimes surprising difficulties, you can reap many benefits: a rich user interface of dialog boxes and menus, multitasking and data exchange with other applications, the ability to implement special-purpose fonts, and a communications device driver with a complete set of function calls. Now matter what the language, we all strive to create programs that execute in the least amount of time while using the fewest number of bytes. Unfortunately, many programmers who use a high-level language have no way to determine which statements are the most efficient. The purpose of this article is twofold. We will discuss various BASIC statements to see which ones are faster and smaller. Then we will examine the actual machine instructions generated by QuickBasic 4 and compare them with the original BASIC source code. The ability to overlay large applications is taken for granted by most modern software developers. Thus, the usrs of Borland International's Turbo Pascal were quite shocked to discover that a built-in overlay capability present in Release 3 was missing from Relaease 4.